package com.ruoyi.my.service.impl.aliyunoss;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.my.domian.aliyunoss.OssUpload;
import com.ruoyi.my.mapper.aliyunoss.OssMapper;
import com.ruoyi.my.service.aliyunoss.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OssServiceImpl implements OssService {

    @Autowired
    OssMapper ossMapper;

    @Override
    public List<OssUpload> selectOssUploadList(OssUpload ossUpload) {
        return ossMapper.selectOssUploadList(ossUpload);
    }

    @Override
    public int deleteOssByIds(Long[] ossIds) {
        return ossMapper.deleteOssByIds(ossIds);
    }

    @Override
    public int updateOssById(OssUpload ossUpload) {
        ossUpload.setUpdateBy(SecurityUtils.getUserId().toString());
        return ossMapper.updateOssById(ossUpload);
    }

    @Override
    public int addOss(OssUpload ossUpload) {
        ossUpload.setCreateBy(SecurityUtils.getUserId().toString());
        return ossMapper.addOss(ossUpload);
    }

}
